//
//  SettingDetailViewController.m
//  宜居HD
//
//  Created by 陈柏兵 on 16/5/3.
//  Copyright © 2016年 张金国. All rights reserved.
//

#import "SettingDetailFunctionViewController.h"
#import "Macro.h"
#import "SettingDetailFunctionViewModel.h"

@interface SettingDetailFunctionViewController ()
@property (nonatomic, strong) UIWebView *signWebView;
@property (nonatomic, strong) SettingDetailFunctionViewModel *settingDetailFunctionViewModel;

@end

@implementation SettingDetailFunctionViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"功能介绍";
    self.view.backgroundColor = kSettingBackgroundColor;
    [self loadNetWork];
    
    [self.signWebView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}

- (UIWebView *)signWebView {
    if (!_signWebView) {
        _signWebView = [[UIWebView alloc]init];
        _signWebView.scrollView.bounces = NO;
        _signWebView.contentMode = UIViewContentModeScaleAspectFit;
        [_signWebView setScalesPageToFit:YES];
        _signWebView.clipsToBounds = YES;
        [self.view addSubview:_signWebView];
    }
    return _signWebView;
}

- (SettingDetailFunctionViewModel *)settingDetailFunctionViewModel {
    if (!_settingDetailFunctionViewModel) {
        _settingDetailFunctionViewModel = [SettingDetailFunctionViewModel new];
        _settingDetailFunctionViewModel.viewObject = self;
    }
    return _settingDetailFunctionViewModel;
}

- (void)loadNetWork {
    [self.settingDetailFunctionViewModel loadRequest];
}

- (void)setFunctiongUrlString:(NSString *)functiongUrlString {
    [_signWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:functiongUrlString]]];
}

@end
